package com.core.image.core.box;

import com.core.image.core.Packet;
import com.core.image.core.SendPacket;
import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT;

import java.io.InputStream;

/**
 * describe: 直流发送packet
 *
 * @author 库琦
 * @date 2020/02/08/13:11
 */
public class StreamDirectSendPacket extends SendPacket<InputStream> {
    private InputStream inputStream;
    public StreamDirectSendPacket(InputStream inputStream){
        //用以读取数据进行输出的输入流。
        this.inputStream = inputStream;
        //长度不固定，所以为最大值。
        this.length = MAX_PACKET_SIZE;
    }
    @Override
    public byte type() {
        return Packet.TYPE_STREAM_DIRECT;
    }

    @Override
    public InputStream createStream() {
        return inputStream;
    }
}
